<?php
include_once dirname(__FILE__)."/../../core/constants.php";
include_once dirname(__FILE__)."/../../core/mainpage.php";

class HomePage extends MainPage
{
    function HomePage()
    {
        $gameName = new HTMLParagraph(GAME_NAME);
        
        $subCell1 = new HTMLTableCell(new HTMLImage(createUrl("images/home_logo.png")));
        $subCell1->setAttribute("valign", "middle");
        $subCell1->setAttribute("width", "280");
        $subCell1->setAttribute("align", "left");
        $subCell2 = new HTMLTableCell($gameName->render().GAME_DESCRIPTION_TOP);
        $subCell2->setAttribute("valign", "top");
        $subCell2->setAttribute("align", "left");
        
        $subRow1 = new HTMLTableRow(array($subCell1, $subCell2));
        
        $subCell1 = new HTMLTableCell(GAME_DESCRIPTION_BOTTOM, 0, 2);
        $subCell1->setAttribute("valign", "top");
        $subCell1->setAttribute("align", "left");
        $subRow2 = new HTMLTableRow($subCell1);
        
        $subTable = new HTMLTable(array($subRow1, $subRow2));
        $subTable->setAttribute("class", "filltable");
        
        parent::MainPage("Benvenuto", $subTable);
    }
}

$p = new HomePage();
$ws = new WebPage("Home Page", $p);
echo $ws->render();
?>
